/**************************************************************************//**
 * @item     CosyOS Kernel
 * @file     psv.h
 * @brief    Public Service for All Thread
 * @author   迟凯峰
 * @version  V2.0.0
 * @date     2023.03.07
 ******************************************************************************/

#ifndef __PSV_H
#define __PSV_H

/*
 * 事件标志组
 */

/* 查询标志组 */
#define	sPSV_QueryFlagGroup(group)	\
(	\
	  sizeof(group) == 1 ? *(u8  *)&group	\
	: sizeof(group) == 2 ? *(u16 *)&group	\
	: sizeof(group) == 4 ? *(u32 *)&group	\
	: false	\
)

/* 清除标志组 */
#define sPSV_ClearFlagGroup(group)	\
do{	\
	  sizeof(group) == 1 ? *(u8  *)&group = false	\
	: sizeof(group) == 2 ? *(u16 *)&group = false	\
	: sizeof(group) == 4 ? *(u32 *)&group = false	\
	: NOOP;	\
}while(false)



#endif
